﻿<%@ Page Language="C#" MasterPageFile="~/admin/Admin.Master" AutoEventWireup="true"
    Codebehind="categoryAE.aspx.cs" Inherits="CMS.admin.categoryAE" Title="Hệ thống quản trị nội dung - Quản lý danh mục" %>

<%@ Register Assembly="ComponentArt.Web.UI" Namespace="ComponentArt.Web.UI" TagPrefix="ComponentArt" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <link href="../css/combobox.css" type="text/css" rel="stylesheet" />
    <link href="../css/treeStyle.css" type="text/css" rel="stylesheet" />

    <script type="text/javascript">
     function TreeView1_onNodeSelect(sender, eventArgs)
      {
        cboParentCate.set_text(eventArgs.get_node().get_text());
        //cboParentCate.set_DataValueField(eventArgs.get_node().get_value());
       document.getElementById('<%=hfSelect.ClientID %>').value=eventArgs.get_node().get_value();
        cboParentCate.collapse();
        
      }
      //Ham chan chi cho phep nhap kieu so
      function isNumberKey(evt)
       {
	    var charCode = (evt.which) ? evt.which : event.keyCode
	    if (charCode > 31 && (charCode < 48 || charCode > 57))
	    return false;

	    return true;
       }

    </script>

    <div style="border: solid 1px #ccc;">
        <div id="toolbox">
            <div class="header" style="float: left; margin-left: -40px;">
                <img src="../images/Toolbox/title-article.png" alt="" id="imgHeader" />
                Quản lý danh mục: thêm/sửa
            </div>
            <div style="float: right;">
                <table class="toolbar">
                    <tr>
                        <td align="center">
                            <asp:LinkButton ID="btnUpdate" runat="server" OnClick="btnUpdate_Click">
                                <asp:Label ID="Label1" CssClass="Icon-32-Save" runat="server" />
                                Cập nhật
                            </asp:LinkButton>
                        </td>
                        <td align="center">
                            <asp:LinkButton ID="btnClose" CausesValidation="false" runat="server" OnClick="btnClose_Click">
                                <asp:Label ID="Label4" CssClass="Icon-32-Cancel" runat="server" />
                                Đóng lại
                            </asp:LinkButton>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <p align="center">
        <br />
        <asp:Label ID="lblMessage" runat="server" BackColor="White" BorderColor="White" ForeColor="Red"></asp:Label>
        <asp:HiddenField ID="hfSelect" runat="Server" />
    </p>
    <div id="content-box">
        <div class="t">
            <div class="t">
                <div class="t">
                </div>
            </div>
        </div>
        <div class="m" style="height:520px;">
            <!--table2:data form-->
            <table width="830" cellpadding="5" border="0" cellspacing="5">
                <tr>
                     <td align="right" style="width: 150px">
                        <asp:Label ID="Label3" runat="server" Text="Trạng thái:"></asp:Label>
                    </td>
                     <td style="text-align: left">
                        <asp:RadioButton ID="rdActive" runat="server" Checked="true" GroupName="rdgTrangThai"
                            Text="Hoạt động" />
                        <asp:RadioButton ID="rdInActive" runat="server" GroupName="rdgTrangThai" Text="Không hoạt động" />
                     </td>
                </tr>
                <tr>
                    <td align="right" style="width: 150px">
                        <asp:Label ID="lblParent" runat="server" Text="Danh mục cha:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <ComponentArt:ComboBox ID="cboParentCate" runat="server" KeyboardEnabled="false"
                            AutoFilter="false" AutoHighlight="false" AutoComplete="false" CssClass="comboBox"
                            HoverCssClass="comboBoxHover" FocusedCssClass="comboBoxHover" TextBoxCssClass="comboTextBox"
                            DropDownCssClass="comboDropDown" ItemCssClass="comboItem" ItemHoverCssClass="comboItemHover"
                            SelectedItemCssClass="comboItemHover" DropHoverImageUrl="../images/drop_hover.gif" 
                            DropImageUrl="../images/drop.gif" Width="200" DropDownHeight="400" DropDownWidth="300">
                           <DropDownContent>
                                <ComponentArt:TreeView ID="TreeView1" DragAndDropEnabled="false" NodeEditingEnabled="false"
                                    KeyboardEnabled="true" CssClass="TreeView" NodeCssClass="TreeNode" SelectedNodeCssClass="SelectedTreeNode"
                                    HoverNodeCssClass="HoverTreeNode" NodeEditCssClass="NodeEdit" LineImageWidth="19"
                                    LineImageHeight="20" DefaultImageWidth="16" DefaultImageHeight="16" ItemSpacing="0"
                                    NodeLabelPadding="3" LineImagesFolderUrl="../images/lines/" Height="400" Width="300"
                                    ShowLines="true"
                                    EnableViewState="false"  runat="server">
                                    <ClientEvents>
                                        <NodeSelect EventHandler="TreeView1_onNodeSelect" />
                                    </ClientEvents>
                                </ComponentArt:TreeView>
                            </DropDownContent>
                            <DropDownFooter>
                            </DropDownFooter>
                        </ComponentArt:ComboBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 150px">
                        <asp:Label ID="Label2" runat="server" Text="Tên danh mục:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtCategoryName" runat="Server" Width="200px"></asp:TextBox>
                        <font color="#ff0000">*</font>&nbsp;&nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtCategoryName" 
                            ErrorMessage="Trường bắt buộc nhập liệu"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 150px">
                        <asp:Label ID="lblDescription" runat="server" Text="Mô tả:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtDescription" runat="Server" Width="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 150px">
                        <asp:Label ID="Label7" runat="server" Text="Thứ tự sắp xếp:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtOrder" runat="Server" Width="50px" onkeypress="return isNumberKey(event);" MaxLength="2"></asp:TextBox>
                        <%--<font color="#ff0000">*</font>&nbsp;&nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtOrder"
                            ErrorMessage="Trường bắt buộc nhập liệu"></asp:RequiredFieldValidator>--%>
                    </td>
                </tr>
                <tr>
                    <td align="right" style="width: 150px">
                        <asp:Label ID="Label5" runat="server" Text="Ưu tiên:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="TextBox1" runat="Server" Width="50px" onkeypress="return isNumberKey(event);" MaxLength="2"></asp:TextBox>
                        <%--<font color="#ff0000">*</font>&nbsp;&nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtOrder"
                            ErrorMessage="Trường bắt buộc nhập liệu"></asp:RequiredFieldValidator>--%>
                    </td>
                </tr>                
                <tr>
                    <td align="right" style="width: 150px">
                        <asp:Label ID="Label8" runat="server" Text="Đường dẫn:"></asp:Label>
                    </td>
                    <td style="text-align: left">
                        <asp:TextBox ID="txtURL" runat="Server" Width="200px"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator9" runat="server" ControlToValidate="txtURL"
                            ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?" ErrorMessage="Không đúng định dạng website."
                            Display="Dynamic" SetFocusOnError="true" />
                    </td>
                </tr>
            </table>
            <!--end:table2-->
            <br />
            <div class="clr">
            </div>
        </div>
        <div class="b">
            <div class="b">
                <div class="b">
                </div>
            </div>
        </div>
    </div>
</asp:Content>
